package com.community.contents;

import java.util.Comparator;
import java.util.Map;
import java.util.TreeMap;

/**
 * @className: test
 * @author: shuishui
 * @date: 2023/03/02 20:58
 */
public class test {
    public static void main(String[] args) {
        Map<Integer,String> map = new TreeMap<Integer,String>(new Comparator<Integer>() {
            @Override
            public int compare(Integer o1, Integer o2) {
                return o2.compareTo(o1);
            }
        });
        map.put(3,"nihao");
        map.put(6,"niehao");
        map.put(2,"nihrao");
        map.put(4,"nihtgao");

        System.out.println(map);
    }
}
